home *** CD-ROM | disk | FTP | other *** search
- /* m2l.ged $VER: 0.12 m2l.ged © 1994 Fin Schuppenhauer (12.06.94) */
-
- OPTIONS RESULTS /* enable return codes */
-
- if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
- address 'GOLDED.1'
-
- 'LOCK CURRENT' /* lock GUI, gain access */
- OPTIONS FAILAT 6 /* ignore warnings */
- SIGNAL ON SYNTAX /* ensure clean exit */
-
-
- /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
-
-
- 'QUERY CAT'
- german = (result = "deutsch")
-
- /* Dateinamen ermitteln: */
- 'QUERY FILE VAR FILENAME'
- if (right(filename, 4) ~= '.def') & (right(filename, 4) ~= '.mod') then do
- if german then
- 'REQUEST BODY="Dies ist kein Modula-2-Quelltext!"'
- else
- 'REQUEST BODY="This is no modula-2 source!"'
- 'UNLOCK'
- EXIT
- end
-
- /* Gibt es überhaupt etwas zu übersetzen ? */
- 'QUERY ANYTEXT'
- if result = 'FALSE' then do
- if german then
- 'REQUEST BODY="Ähmm, kein Quelltext hier.|Trotzdem linken?" BUTTON=Ja|Nein'
- else
- 'REQUEST BODY="There''s no source here.|Still link ?" BUTTON=Yes|No'
- if result= '0' then do
- 'UNLOCK'
- EXIT
- end
- end
-
- /* Text verändert? Wenn ja, vorher sichern. */
- 'QUERY MODIFY'
- if result = 'TRUE' then do
- if german then
- 'REQUEST BODY="Upps, der Text wurde aber verändert!"'
- else
- 'REQUEST BODY="Urgh, there''s modified source here!"'
- 'UNLOCK'
- EXIT
- end
-
- /* Ist der Compiler aktiv ? */
- if ~show('P', 'M2L') then do
- if german then
- 'REQUEST BODY="Der Linker läuft nicht!|Bitte starten."'
- else
- 'REQUEST BODY="The linker is not running!|Please start."'
- 'UNLOCK'
- EXIT
- end
-
- /* Linke-Optionen ermitteln (sind (fast) alle per Default TRUE) */
- linkopt = "-"
- 'QUERY USER20' /* SmallCode */
- if result='FALSE' then
- linkopt = linkopt || "c"
-
- 'QUERY USER19' /* SmallData */
- if result='FALSE' then
- linkopt = linkopt || "d"
-
- 'QUERY USER16' /* DebugInfo */
- if result='FALSE' then
- linkopt = linkopt || "x"
-
- if linkopt = "-" then
- linkopt = ""
-
- /* Minimalarts? Resident? */
- 'QUERY USER18' /* MinimalArts */
- if result='TRUE' then
- linkopt = linkopt || "+m"
-
- 'QUERY USER17' /* Resident */
- if result='TRUE' then
- linkopt = linkopt || "+r"
-
- /* Piktogramme erzeugen? */
- 'QUERY USER14'
- if result = 'TRUE' then
- icons = "+i"
- else
- icons = "-i"
-
-
- filename = left(filename, length(filename)-4) || '.obj'
-
- if german then
- 'REQUEST STATUS="Binde nun 'filename' .."'
- else
- 'REQUEST STATUS="Linking 'filename' ..."'
-
- OPTIONS FAILAT 21
- ADDRESS 'M2L' "LINK " || linkopt || icons || " " || filename
-
- 'REQUEST STATUS=""'
-
- if rc ~= 0 then do
- if german then
- 'REQUEST BODY="Es sind Fehler aufgetreten!"'
- else
- 'REQUEST BODY="Some errors occured!"'
- end
- else do
- if german then
- 'REQUEST BODY="Erfolgreich gelinkt."'
- else
- 'REQUEST BODY="Linked successfully."'
- end
-
- /* ---------------------------- END OF YOUR CODE --------------------- */
-
- 'UNLOCK' /* VERY important: unlock GUI */
- EXIT
-
- SYNTAX:
-
- SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
- 'UNLOCK'
- EXIT
-